Stacks and Queues

IMPORTANT

Stacks and Queues: Overview

This topic covers concepts, such as Properties of Stacks, Types of Queues, Double-Ended Queues, FIFO - First In First Out, Implementation of Stacks, Characteristics of Circular Queue, Input-restricted Dequeue, Output-restricted Dequeue, etc.

Important Questions on Stacks and Queues

HARD
IMPORTANT

The term push and pop is related to

MEDIUM
IMPORTANT

Which data structure follows the FIFO Principle.

HARD
IMPORTANT

void insert_front()
{   int added_item;
    if((front == 0 && rear == Size-1) || (front == rear+1))
    {   printf("Queue Overflow \n");
        return;  }
    if (front == -1)/*If queue is initially empty*/
    {   front = 0;
        rear = 0;    }
    else
    if(front== 0)
        front=Size-1;
    else
        front=front-1;
    printf("Input the element for adding in queue : ");
    scanf("%d", &added_item);
    deque_arr[front] = added_item ;  }

 

EASY
IMPORTANT

For implementing deque, we need to keep track of two indices, front and rear.

MEDIUM
IMPORTANT

For implementing deque, need to keep track of two ____, front and rear.

MEDIUM
IMPORTANT

Select the Circular queue's characteristics

MEDIUM
IMPORTANT

Which of the following is not an application of priority queue?

EASY
IMPORTANT

What data structure can a priority queue be implemented

MEDIUM
IMPORTANT

What is the need for a circular queue

MEDIUM
IMPORTANT

Time complexity of enqueue operation is

MEDIUM
IMPORTANT

The term for inserting an element into a full queue is

MEDIUM
IMPORTANT

Which of the following properties is with a queue?

MEDIUM
IMPORTANT

Which application of stack is used to ensure that the pair of parentheses are properly nested?

MEDIUM
IMPORTANT

Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some order). The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the computation?

MEDIUM
IMPORTANT

What is the value of the postfix expression 12 3 2 4 + – *?

MEDIUM
IMPORTANT

Case:

If the stack size is 7. 

The user is pushing the element.

Stack Pointer is at 6th location.

What will be the outcome??

EASY
IMPORTANT

Stack is a linear data structure which follows a particular order

EASY
IMPORTANT

Which among the below mentioned entities is/are essential for an Array Representation of a Queue?